<?php echo $this->render('inc/header.htm') ?>
	<!-- Page content -->
	<div id="page">
		<!-- Wrapper -->
		<div class="wrapper">
			<!-- left column/section -->
			<?php echo $this->render('inc/_left_nav.htm') ?>
			<!-- End of left column/section -->
			<?php
				if($this->totalItems == 0) {
					$start_num = $end_num = 0;
				}else {
					$cur_page = isset($_GET['pageID'])?$_GET['pageID']:1;
					$start_num = (($cur_page - 1) * $this->perPage) + 1;
					$end_num = $start_num + $this->perPage - 1;
					if($end_num > $this->totalItems) {
						$end_num = $this->totalItems;
					}
				}
			?>
			<!-- right column/section -->
			<section class="column width6 right_content">
				<div id="tabs" class="ui-tabs ui-widget ui-widget-content ui-corner-all user-list-tab">
					<ul class="ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all">
						<li class="ui-state-default ui-corner-top<?php if($this->type == 'user') echo ' ui-tabs-selected ui-state-active' ?>"><a href="<?php if($this->type == 'user') echo 'javascript:void(0);'; else echo __PROJECTNAME__ . '/admin/user/user-list'; ?>" class="corner-tl">用户列表</a></li>
						<li class="ui-state-default ui-corner-top<?php if($this->type == 'admin') echo ' ui-tabs-selected ui-state-active' ?>"><a href="<?php if($this->type == 'admin') echo 'javascript:void(0);'; else echo __PROJECTNAME__ . '/admin/user/user-list/type/admin'; ?>" class="">管理员列表</a></li>
						<li class="ui-state-default ui-corner-top"><a href="<?php echo __PROJECTNAME__ ?>/admin/user/add-<?php if($this->type == 'admin') echo 'admin'; else echo 'user'; ?>" class="corner-tr">添加<?php if($this->type == 'admin') echo '管理员'; else echo '用户'; ?></a></li>
					</ul>
					<div id="tabs-date" class="ui-tabs-panel ui-widget-content ui-corner-bottom">
						<div class="colgroup">
							<div class="width3 column first">
								<p>Showing <b><?php echo $start_num ?>-<?php echo $end_num ?></b> of <b><?php echo $this->totalItems ?></b> results</p>
							</div>
							<div class="width3 column pager">
								<p class="pagination ta-right">
									<?php echo str_replace(array('<b>','</b>'),array('<a href="#" class="pagination-active">','</a>'),$this->page['all']) ?>
								</p>
							</div>
						</div>
						<hr>
						<table style="" class="stylized full" id="report">
							<thead>
								<tr>
									<th>id</th>
									<th>用户名</th>
									<th>部门</th>
									<th>用户组</th>
									<th>创建时间</th>
									<th>操作</th>
								</tr>
							</thead>
							<tbody>
								<?php
									if(!empty($this->pageData)) {
										foreach($this->pageData as $v) {
								?>
								<tr>
									<td><?php echo $v['user_id'] ?></td>
									<td class="title">
										<a href="<?php echo __PROJECTNAME__ ?>/user/profile/uid/<?php echo $v['user_id'] ?>" target="_blank"><?php echo $v['user_name']; ?></a><?php echo $v['real_name']?'('.$v['real_name'].')':''; ?>
									</td>
									<td><?php echo $v['department']?$v['department']:$v['user_app_ext1']; ?></td>
									<td><?php echo $v['group_name']?$v['group_name']:'普通用户' ?></td>
									<td><?php echo date('Y-m-d',$v['reg_time']) ?></td>
									<td>
										<?php if($v['user_id'] != '1') { ?>
										<a href="<?php echo __PROJECTNAME__ ?>/admin/user/edit-<?php echo $this->type ?>?uid=<?php echo $v['user_id'] ?>">编辑</a> |
										<a href="<?php echo __PROJECTNAME__ ?>/admin/user/delete-<?php echo $this->type ?>?uid=<?php echo $v['user_id'] ?>" onclick="javascript: if(!confirm('您确认要进行删除操作？')){return false;}">删除</a>
										<?php }else { ?>
										--
										<?php } ?>
									</td>
								</tr>
								<?php
										}
									}else {
								?>
								<tr>
									<td class="title" colspan="5"><center>暂无数据</center></td>
								</tr>
								<?php } ?>
							</tbody>
						</table>
						<hr>
						<div class="colgroup leading">
							<div class="width3 column first">
								<p>Showing <b><?php echo $start_num ?>-<?php echo $end_num ?></b> of <b><?php echo $this->totalItems ?></b> results</p>
							</div>
							<div class="width3 column pager">
								<p class="pagination ta-right">
									<?php echo str_replace(array('<b>','</b>'),array('<a href="#" class="pagination-active">','</a>'),$this->page['all']) ?>
								</p>
							</div>
						</div>
						<div class="clearfix"></div>
					</div>
				</div>
			</section>
			<!-- End of right column/section -->
		</div>
		<!-- End of Wrapper -->
	</div>
	<!-- End of Page content -->
<?php echo $this->render('inc/footer.htm') ?>